<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <c:if test="${msg!=null}">
        <script type="text/javascript">
            var msg = "${msg}"
            alert(msg);
        </script>
    </c:if>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title>微博 - ${logonUser.nickName}的贝壳问题</title>
    <script type="text/javascript" src="script/ajax.js"></script>
    <script type="text/javascript" src="script/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="script/profile.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="testJs/style.css">
    <link rel="stylesheet" type="text/css" media="all" href="testJs/mo.css">
    <script type="text/javascript" src="testJs/jquery.js "></script>
    <script type="text/javascript" src="testJs/touchslide.js "></script>
    <link rel="dns-prefetch" href="http://s.w.org/">
    <link rel="stylesheet" id="dashicons-css" href="testJs/dashicons.min.css" type="text/css" media="all">
    <link rel='stylesheet' id='admin-bar-css' href='testJs/admin-bar.min.css' type='text/css' media='all'/>
    <script>
        function Ashow() {
            new Face("inputbox").show()
        }
    </script>
</head>
<body class="bg">
<!-- header开始-->
<%@include file="../header.jsp" %>
<!-- header结束-->
<div id="header" style="padding-top: 30px">
    <div class="wrapper">
        <div class="nav fl">
            <a href="javascript:;" class="nav-m"><i class="mo-menu"></i></a>
            <div class="logo fl">
                <h1><a href="http://localhost/wordpress" title="微博"><img src="images/logo.png"></a>
                </h1>
            </div>
            <ul class="menu fr">
                <div class="menu">
                    <ul>
                        <li class=""><a href="home">贝壳</a></li>
                    </ul>
                </div>
            </ul>
        </div>
    </div>
</div>
<!-- container 开始-->
<div id="content">
    <div class="wrapper">
        <div class="main fl">
            <div class="list w750 mt35">
                <table border="0" align="center" cellpadding="0" cellspacing="0" id="container">
                    <tr>
                        <td width="670" height="600" valign="top">
                            <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" id="curruser">
                                <tr>
                                    <td width="24%" style="width: 91px; "><img src="${detailMap.shell.chUser.images}"
                                                                               width="120"
                                                                               height="120" class="userphoto"/></td>
                                    <td width="76%" valign="top">
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0"
                                               id="curruserdetail">
                                            <tr>
                                                <td><a href="userIndex?userId=${detailMap.shell.chUser.id}">
                                                    ${detailMap.shell.chUser.nickName}</a><a style="color: red">
                                                    <c:if test="${detailMap.shell.chUser.conchIntegral >=0 && detailMap.shell.chUser.conchIntegral<=300}">【初出茅庐】</c:if>
                                                    <c:if test="${detailMap.shell.chUser.conchIntegral >300 && detailMap.shell.chUser.conchIntegral<=600}">【学富五车】</c:if>
                                                    <c:if test="${detailMap.shell.chUser.conchIntegral >600 && detailMap.shell.chUser.conchIntegral<=1000}">【 名杨万里】</c:if>
                                                    <c:if test="${detailMap.shell.chUser.conchIntegral >1000}">【博古通今】</c:if>
                                                </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${detailMap.shell.shellTime}发布
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <p>
                                                        ${detailMap.shell.shellBody}
                                                        <br><br>
                                                        <a href="javaScript:void(0)">悬赏积分(${detailMap.shell.sNumber})</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a
                                                            href="javaScript:void(0)">
                                                        <c:if test="${detailMap.shell.state == 0}">未解决</c:if>
                                                        <c:if test="${detailMap.shell.state == 1}">已解决</c:if>
                                                    </a></p></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>

                            <!-- weibotwo 开始-->

                            <c:forEach items="${detailMap.conchComm}" var="comm">
                                <table id="weibo" width="90%" border="0" align="center" cellpadding="3" cellspacing="0"
                                       style="background-color: #F8F8F8">
                                    <tr>
                                        <td rowspan="3" align="center" valign="top"><img src="${comm.commUser.images}"
                                                                                         width="50"
                                                                                         height="50"/></td>
                                        <td width="88%" class="content"><a
                                                href="user_index?userId=${comm.commUser.id}">${comm.commUser.nickName}</a><a
                                                style="color: red">
                                            <c:if test="${comm.commUser.conchIntegral >=0 && comm.commUser.conchIntegral<=300}">【初出茅庐】</c:if>
                                            <c:if test="${comm.commUser.conchIntegral >300 && comm.commUser.conchIntegral<=600}">【学富五车】</c:if>
                                            <c:if test="${comm.commUser.conchIntegral >600 && comm.commUser.conchIntegral<=1000}">【 名杨万里】</c:if>
                                            <c:if test="${comm.commUser.conchIntegral >1000}">【博古通今】</c:if>
                                        </a><br>${comm.commentBody}</td>
                                    </tr>
                                    <tr>
                                        <td height="25">
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0"
                                                   id="weibo_status">
                                                <tr>
                                                    <td>${comm.commentDate}</td>
                                                    <td align="right">

                                                        <c:if test="${comm.commentState == 100 && detailMap.shell.state == 0 && detailMap.shell.chUser.id==loginUser.id}">
                                                            <a href="adoptComm?shellId=${detailMap.shell.id}&comm=${comm.id}"
                                                               style="text-decoration:none">采纳</a>
                                                        </c:if>
                                                        <c:if test="${comm.commentState == 101 && detailMap.shell.state == 1}">
                                                            <a href="javaScript:void(0)" style="text-decoration:none">已采纳</a>
                                                        </c:if>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr></tr>
                                </table>
                                <br/>
                            </c:forEach>

                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table id="weibo" width="90%" border="0" align="center" cellpadding="3" cellspacing="0"
                                   style="background-color: #F8F8F8">
                                <tr>
                                    <td rowspan="3" align="center" valign="top"><img src="${loginUser.images}"
                                                                                     width="50"
                                                                                     height="50"/>
                                    </td>
                                    <td width="88%" class="content"><a href="userIndex?userId=${loginUser.id}">回复人</a><a
                                            style="color: red">
                                        <c:if test="${loginUser.conchIntegral >=0 && loginUser.conchIntegral<=300}">【初出茅庐】</c:if>
                                        <c:if test="${loginUser.conchIntegral >300 && loginUser.conchIntegral<=600}">【学富五车】</c:if>
                                        <c:if test="${loginUser.conchIntegral >600 && loginUser.conchIntegral<=1000}">【 名杨万里】</c:if>
                                        <c:if test="${loginUser.conchIntegral >1000}">【博古通今】</c:if>
                                    </a>
                                        <form action="shellComm?userId=${detailMap.shell.chUser.id}&shellId=${detailMap.shell.id}"
                                              method="post">
                                            <textarea  rows="" cols="inputbox" id="inputbox" name="inputbox" style="width: 403px; height: 60px; ;background-color: #00dbde" ></textarea>
                                            <a href="javaScript:void(0)" onclick="Ashow()">表情</a>&nbsp;&nbsp;&nbsp;
                                            <input type="submit" value="回复">
                                        </form>
                                    </td>
                                    <td>
                                        <div id="faces"></div>
                                    </td>
                                </tr>
                                <tr></tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <!-- container 结束-->
            </div>
        </div>
        <div class="sidebar w320 fr">
            <div id="localtime">
                <font>2019-04-26 18:27:30 星期五</font>
            </div>
            <jsp:include page="../userinfo.jsp"/>
        </div>

        <!--footer开始-->
        <%@include file="../footer.jsp" %>
        <!--footer结束-->
        <script type="text/javascript">
            function conchComm(uId, cId) {
                var inputbox = document.getElementById("inputbox").value;
                var url = "conchComm?userId=" + uId + "&shellId=" + cId + "$inputbox=" + inputbox;
                var xhr = createXMLHttpRequest();
                xhr.open("POST", url, true);
                xhr.onreadystatechange = seekCallBake;
                xhr.send(null);

                function seekCallBake() {
                    if (xhr.readyState == 4 && xhr.status == 200) {
                    }
                }

                alert("回复成功！")
                document.getElementById("inputbox").value = "";
            }
        </script>
    </div>
</body>
</html>